<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab y-borderB">
      <div class="tab-item">
        <router-link to="/goods">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/ratings">评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/seller">商家</router-link>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
  import Header from './components/header/header.vue'

  const ERR_OK = 0;
  export default {
    name: 'app',
    data() {
        return {
          seller:''
        }
    },
    created() {
      this.$http.get('/api/seller').then(function(response){
        response=response.body;
        if(response.errno===ERR_OK){
          this.seller = response.data;
          //console.log(this.seller);
        }
      })
    },
    components:{
      'v-header':Header
    }
  }
</script>

<style scoped>
body,html{
  line-height: 1;
  font-weight: 200;
  font-family: "PingFang SC", "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
}

  .tab{display: flex; width: 100%; line-height:40px;}
  .y-borderB{
    position: relative;
  }
  .y-borderB:after{
    content: '';
    position: absolute;
    left:0;
    bottom: 0;
    height: 1px;
    width:100%;
    display: block;
    background-color:rgba(7,17,27,0.1)
  }
  .tab .tab-item{flex:1; text-align: center;}
  .tab-item>a{display: block; font-size: 14px; color:rgb(77,85,93)}
  .tab-item>a.active{color: rgb(240,20,20)}
</style>
